package com.google.gwt.sample.dynatablerf.server.business;

import java.util.List;

import com.google.gwt.sample.dynatablerf.server.dao.IDAOManager;
import com.google.gwt.sample.dynatablerf.server.domain.AbstractEntity;
import com.google.gwt.sample.dynatablerf.server.domain.AbstractEntityQueryParams;

public interface Controlador<T extends AbstractEntity, G extends AbstractEntityQueryParams> {

	T persist(T entity);

	void persist(List<T> list);

	void setDaoManager(IDAOManager<T, G> daoManager);

	T findById(Long id);

	T find(G params);

	List<T> findAll(int startIndex, int maxResult);

	List<T> findAll(G params, int startIndex, int maxResult);

	Long countAll();

	Long count(G params);

	Long count(String queryName, G params);

	List<T> findSuggestions(String suggestion, int maxResult);

	List<T> findSuggestions(String suggestion, G params, int maxResult);
}
